import axios from "axios";
import baseUrl from './baseUrl';

// createAxios
function createAxios() {
  // instance
  const instance = axios.create({
    baseURL: baseUrl,
    timeout: 50000
  });

  // defaults
  instance.defaults.headers.post["Content-Type"] = "application/json;charset=utf-8";
  instance.defaults.headers.get["Content-Type"] = "application/x-www-form-urlencoded;charset=utf-8";

  return instance;
}

//
export default createAxios;
